$def with (list)

$def json_link():
    <a rel="nofollow" href="$list.url('/export?format=json')">JSON</a>

$def html_link():
    <a rel="nofollow" href="$list.url('/export?format=html')">HTML</a>

$def bibtex_link():
    <a rel="nofollow" href="$list.url('/export?format=bibtex')">BibTex</a>

<div id="listTools">
    $if list.edition_count <= 10000:
        <ul>
            <li>
                <span class="icon export"></span>
                <span class="larger black"><strong>$_('Export')</strong></span><br/>
                $:_("as %(json_link)s, %(html_link)s, or %(bibtex_link)s", json_link=json_link(), html_link=html_link(), bibtex_link=bibtex_link())
            </li>
            <li>
                <span class="icon subscribe"></span>
                <span class="larger black"><strong>$_('Subscribe')</strong></span><br/>
                $:_('Watch activity via <a rel="nofollow" href="%s">Atom feed</a>', list.url('/feeds/updates.atom'))
            </li>
        </ul>
    $else:
        <ul>
            <li style="padding-bottom:10px;">
                <span class="icon export"></span>
                <span class="larger grey"><strong>$_('Export Not Available')</strong></span>
            </li>
            <li>
                <span class="icon alert" style="height:115px;"></span>
                <span class="smaller grey">
                $_("Only lists with up to %(max)s editions can be exported. This one has %(count)s.", max=commify(10000), count=commify(list.edition_count))
                <br/><br/>
                $:_('Try removing some seeds for more focus, or look at <a href="%s">bulk download</a> of the catalog.', "/data#bulk_download")
                </span><br />&nbsp;
            </li>
            <li>
                <span class="icon subscribe"></span>
                <span class="larger black"><strong>$_('Subscribe')</strong></span><br/>
                $:_('Watch activity via <a rel="nofollow" href="%s">Atom feed</a>', list.url('/feeds/updates.atom'))
            </li>
        </ul>
</div>
